package com.simpletour.qa.service.repository;

import com.simpletour.qa.service.entity.Solution;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;


public interface SolutionRepository extends JpaRepository<Solution,Integer> {

    List<Solution> findByQuestionId(int questionId,Pageable pageable);


    @Query(" select count(questionId) from Solution where questionId = :questionId")
    int findCountByQuestionId(@Param("questionId") int questionId);
}
